{% extends "base.html" %}
{% block title %}列表{% endblock %}
{% block content %}
{% if info %}
    <p>{{info}}</p>
{% endif %}
{% if chart_list %}
    <table class="table">
        <thead><tr><td>#</td><td>名称</td><td>日期</td><td>打开</td></tr></thead>
        <tbody>
         {% for item in chart_list %}
        <tr>
            <td>{{ item.id }}</td><td>{{ item.title }}</td><td>{{item.created}}</td>

            <td><a href="{% url 'chart'  item.id %}"> 打开</a></td>
        </tr>

        {% endfor %}
        </tbody>
    </table>
     {% if is_paginated %}
    <div class="pagination">
        <span class="page-links">
            {% if page_obj.has_previous %}
                <a href="/project?page={{ page_obj.previous_page_number }}">上一页</a>
            {% endif %}
            {% if page_obj.has_next %}
                <a href="/project?page={{ page_obj.next_page_number }}">下一页</a>
            {% endif %}
            <span class="page-current">
                第{{ page_obj.number }}页 ，共{{ page_obj.paginator.num_pages }}页。
            </span>
        </span>
    </div>
    {%endif%}
{% else %}
    <p>没有</p>
{% endif %}
<hr>
<div class="well">上传数据xlsx或csv创建动图，格式：name, value, date,代表名称，数值，时间（2018/01/01）</div>
 <form method=post enctype=multipart/form-data class="form-inline" action="{% url 'load_data' %}">
            <input
                  type="hidden"
                  name='csrfmiddlewaretoken'
                  value="{{csrf_token}}"
                >

                <div class="form-group">
                    <input type='file' name='file'>
                </div>

                <div class="form-group">
                  <input type='submit' value='提交'>
                </div>

              </form>
{% endblock%}